gtk4.git
6 years agosurface: Always dd events to the profiler trace
Matthias Clasen [Wed, 22 Jan 2020 21:36:54 +0000 (16:36 -0500)]
surface: Always dd events to the profiler trace

We want to get this data for release builds as well.

6 years agoframe clock: Redo the profiler marks
Matthias Clasen [Wed, 22 Jan 2020 21:36:02 +0000 (16:36 -0500)]
frame clock: Redo the profiler marks

Instead of reporting the frame clock phases as defined,
report the duration of the signal emissions, which is more
useful for tracking down what is taking time.

6 years agoci: Save syscap files from performance tests
Matthias Clasen [Wed, 22 Jan 2020 20:55:31 +0000 (15:55 -0500)]
ci: Save syscap files from performance tests

They might become useful at some point.

6 years agowindow: Rename a profiler mark
Matthias Clasen [Wed, 22 Jan 2020 20:10:35 +0000 (15:10 -0500)]
window: Rename a profiler mark

The "layout" name was already taken for the frame clock
phase by that name. Oops.

6 years agowayland: Add profiler marks around surface handling
Matthias Clasen [Wed, 22 Jan 2020 19:51:40 +0000 (14:51 -0500)]
wayland: Add profiler marks around surface handling

Add marks for when we do commits, swap buffer or
receive frame events. These are the low-level start
and end points of the frame cycle, and it is useful
to see them in the profiler.

6 years agosurface: Add enter/leave events to profiler traces
Matthias Clasen [Wed, 22 Jan 2020 19:50:54 +0000 (14:50 -0500)]
surface: Add enter/leave events to profiler traces

These are just as likely to trigger extra work than
other mouse events, so it is useful to show them.

6 years agoicontheme: Add profiler marks for loading icons
Matthias Clasen [Wed, 22 Jan 2020 19:49:17 +0000 (14:49 -0500)]
icontheme: Add profiler marks for loading icons

This helps to clearly identify the places where we
do IO, in profiler traces.

6 years agoUpdate Japanese translation
sicklylife [Wed, 22 Jan 2020 17:32:21 +0000 (17:32 +0000)]
Update Japanese translation

6 years agoUpdate Japanese translation
sicklylife [Wed, 22 Jan 2020 17:29:36 +0000 (17:29 +0000)]
Update Japanese translation

6 years agoMerge branch 'wip/jimmac/typography-classes' into 'master'
Matthias Clasen [Wed, 22 Jan 2020 12:54:48 +0000 (12:54 +0000)]
Merge branch 'wip/jimmac/typography-classes' into 'master'

Adwaita: general typography classes

Closes #1808

See merge request GNOME/gtk!1339

6 years agoAdwaita: general typography classes
Jakub Steiner [Wed, 22 Jan 2020 11:02:51 +0000 (12:02 +0100)]
Adwaita: general typography classes

- many moons and some iterations later, these are the suggested
  general typographic styles. Already being referenced in apps like
  Banner Viewer (for now shipping custom definitions)

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1808

6 years agotestsuite: Move the meson performance tests up
Matthias Clasen [Wed, 22 Jan 2020 05:58:13 +0000 (00:58 -0500)]
testsuite: Move the meson performance tests up

Since the binary is moved, there is no need for
the subdirectory here anymore.

6 years agoMake the performance testcase more general
Matthias Clasen [Wed, 22 Jan 2020 05:55:11 +0000 (00:55 -0500)]
Make the performance testcase more general

Reuse the performance test for layout and snapshot timings.

6 years agocss: Make performance test more flexible
Matthias Clasen [Wed, 22 Jan 2020 05:29:43 +0000 (00:29 -0500)]
css: Make performance test more flexible

Allow to specify the name of the mark that we're looking
for the first instance of.

6 years agowidget: Add profiler marks
Matthias Clasen [Wed, 22 Jan 2020 04:43:37 +0000 (23:43 -0500)]
widget: Add profiler marks

This gives high-level entries for the duration of
snapshotting and layout in the frame cycle.

6 years agowindow: Add a profiler mark around size allocation
Matthias Clasen [Wed, 22 Jan 2020 04:43:01 +0000 (23:43 -0500)]
window: Add a profiler mark around size allocation

This give a high-level entry for the duration of size allocation
in the frame cycle.

6 years agocontainer: Remove an unnecessary check
Matthias Clasen [Wed, 22 Jan 2020 04:19:24 +0000 (23:19 -0500)]
container: Remove an unnecessary check

GtkWindow implements GtkRoot, so we can avoid
treating them separately.

6 years agoMerge branch 'matthiasc/perf-tests' into 'master'
Matthias Clasen [Wed, 22 Jan 2020 03:38:50 +0000 (03:38 +0000)]
Merge branch 'matthiasc/perf-tests' into 'master'

Performance tests

See merge request GNOME/gtk!1338

6 years agotestsuite: Make performance test fail
Matthias Clasen [Wed, 22 Jan 2020 00:55:08 +0000 (19:55 -0500)]
testsuite: Make performance test fail

If a child process exits unsuccessfully,
make the performance test fail.

6 years agotestsuite: Point performance tests at uninstalled schemas
Matthias Clasen [Wed, 22 Jan 2020 00:51:14 +0000 (19:51 -0500)]
testsuite: Point performance tests at uninstalled schemas

widget-factory won't run otherwise.

6 years agoUse the v9 image for ci runs
Matthias Clasen [Wed, 22 Jan 2020 00:30:59 +0000 (19:30 -0500)]
Use the v9 image for ci runs

The v9 image add sysprof-devel, so we can build
and run performance tests using libsysprof.

6 years agoci: Build with profiler support
Matthias Clasen [Tue, 21 Jan 2020 23:20:05 +0000 (18:20 -0500)]
ci: Build with profiler support

This will let us run sysprof-based performance tests.

6 years agoci: Add sysprof-devel to the image
Matthias Clasen [Tue, 21 Jan 2020 23:17:50 +0000 (18:17 -0500)]
ci: Add sysprof-devel to the image

We need it to build with profiler support.

6 years agoFix testsuite without -Dprofiler=true
Matthias Clasen [Tue, 21 Jan 2020 23:09:43 +0000 (18:09 -0500)]
Fix testsuite without -Dprofiler=true

Only build and run the performance tests if we have sysprof.

6 years agoRun the css performance test in the testsuite
Matthias Clasen [Tue, 21 Jan 2020 22:49:40 +0000 (17:49 -0500)]
Run the css performance test in the testsuite

The numbers just end up in the testlog for now.

6 years agoPrototype a sysprof helper
Matthias Clasen [Tue, 21 Jan 2020 18:59:12 +0000 (13:59 -0500)]
Prototype a sysprof helper

This is an attempt to see how we can use sysprof data
in our tests to extract useful performance numbers.

Use it as a wrapper around any GTK+ process:

./testperf ./gtk4-widget-factory

Currently, it repeatedly runs the given commandline,
extracts the first css validation time from the resulting
syscap file, and prints out the min/max/avg of the runs
at the end.

This relies on the environment variable GTK_DEBUG_AUTO_QUIT
to cause the process to exit soon after launch.

6 years agowidget-factory: Add a way to quit automatically
Matthias Clasen [Tue, 21 Jan 2020 21:57:20 +0000 (16:57 -0500)]
widget-factory: Add a way to quit automatically

This can be used to measure startup cost in tests.

6 years agogdk: Make profiler support unconditional
Matthias Clasen [Tue, 21 Jan 2020 16:50:12 +0000 (11:50 -0500)]
gdk: Make profiler support unconditional

We are still not providing samples unless debugging is enabled.
That needs a bit more work.

6 years agocssnode: Make the profiler support unconditional
Matthias Clasen [Tue, 21 Jan 2020 16:38:34 +0000 (11:38 -0500)]
cssnode: Make the profiler support unconditional

6 years agoMerge branch 'otte/for-master' into 'master'
Matthias Clasen [Tue, 21 Jan 2020 16:17:17 +0000 (16:17 +0000)]
Merge branch 'otte/for-master' into 'master'

selector: Add GtkSelectorCategory

See merge request GNOME/gtk!1337

6 years agoselector: Add GtkSelectorCategory
Benjamin Otte [Tue, 21 Jan 2020 15:51:55 +0000 (16:51 +0100)]
selector: Add GtkSelectorCategory

This will make it easier to write more complex matching algorithms.

6 years agoMerge branch 'otte/for-master' into 'master'
Benjamin Otte [Tue, 21 Jan 2020 14:13:02 +0000 (14:13 +0000)]
Merge branch 'otte/for-master' into 'master'

Otte/for master

See merge request GNOME/gtk!1336

6 years agostylecontext: Remove excess gtk_css_node_invalidate() call
Benjamin Otte [Tue, 21 Jan 2020 13:43:31 +0000 (14:43 +0100)]
stylecontext: Remove excess gtk_css_node_invalidate() call

This call is not necessary, because gtk_css_node_set_parent() does the
right thing. (It probably hasn't been necessary for years, but I'm
not gonna try my luck on GTK3 at this stage.)

This code is usually called the first time
gtk_widget_get_style_context() is called on a widget and its style
context gets create. At that point however, the css nodes are in the
right place already, so no invalidation should happen.

6 years agoMerge branch 'otte/for-master' into 'master'
Benjamin Otte [Tue, 21 Jan 2020 12:09:26 +0000 (12:09 +0000)]
Merge branch 'otte/for-master' into 'master'

Otte/for master

See merge request GNOME/gtk!1333

6 years agowin32: Don't save/restore the context for querying the font
Benjamin Otte [Tue, 21 Jan 2020 11:48:20 +0000 (12:48 +0100)]
win32: Don't save/restore the context for querying the font

Use the font in the current state.

6 years agowidget: Remove gtk_widget_get_path()
Benjamin Otte [Tue, 21 Jan 2020 02:05:38 +0000 (03:05 +0100)]
widget: Remove gtk_widget_get_path()

6 years agocssnode: Remove unused widget path vfuncs
Benjamin Otte [Tue, 21 Jan 2020 02:03:46 +0000 (03:03 +0100)]
cssnode: Remove unused widget path vfuncs

6 years agocontainter: Remove gtk_container_get_path_for_child()
Benjamin Otte [Tue, 21 Jan 2020 01:59:26 +0000 (02:59 +0100)]
containter: Remove gtk_container_get_path_for_child()

6 years agostylecontext: Change semantics of gtk_style_context_get_path()
Benjamin Otte [Tue, 21 Jan 2020 01:54:55 +0000 (02:54 +0100)]
stylecontext: Change semantics of gtk_style_context_get_path()

Widget contexts now return NULL here. A non-NULL result requires a
previous call to gtk_style_context_set_path()

6 years agowidget: Initialize cssnode name asap
Benjamin Otte [Tue, 21 Jan 2020 01:50:07 +0000 (02:50 +0100)]
widget: Initialize cssnode name asap

That way, it's correct in subclass's init functions.

6 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Tue, 21 Jan 2020 04:52:12 +0000 (04:52 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Add some static assertions

See merge request GNOME/gtk!1334

6 years agoAdd some static assertions
Matthias Clasen [Tue, 21 Jan 2020 03:53:25 +0000 (22:53 -0500)]
Add some static assertions

Add assertions that ensure the relationships between
css property IDs that we rely on are preserved.

6 years agoAdd profiler support for css validation
Matthias Clasen [Tue, 21 Jan 2020 01:08:41 +0000 (20:08 -0500)]
Add profiler support for css validation

Push numbers about css validation and style creation
to sysprof.

6 years agotextview: Make cursor work when blinking is disabled
Benjamin Otte [Tue, 8 Oct 2019 19:16:25 +0000 (21:16 +0200)]
textview: Make cursor work when blinking is disabled

6 years agocssselector: Inline a few things
Matthias Clasen [Sun, 19 Jan 2020 20:48:17 +0000 (15:48 -0500)]
cssselector: Inline a few things

6 years agostyle cascade: Remove some pointless casts
Matthias Clasen [Sun, 19 Jan 2020 06:09:11 +0000 (01:09 -0500)]
style cascade: Remove some pointless casts

The casts and checks in gtkstylecascade.c are leftovers
from when we had GtkStyleProviderPrivate, and no longer
serve any purpose.

6 years agopick: Take advantage of transform categories
Matthias Clasen [Sun, 19 Jan 2020 06:12:19 +0000 (01:12 -0500)]
pick: Take advantage of transform categories

Transform categories let us easily avoid doing matrix math
when we can just do a simple translation.

6 years agoRefactor gtk_widget_pick
Matthias Clasen [Sun, 19 Jan 2020 05:41:45 +0000 (00:41 -0500)]
Refactor gtk_widget_pick

Split this into a recursive part and a public
entry point. This lets us avoid some duplicate
checks.

6 years agoUpdate Polish translation
Piotr Drąg [Sun, 19 Jan 2020 12:04:34 +0000 (13:04 +0100)]
Update Polish translation

6 years agocss: Redo the pseudoclass selectors
Matthias Clasen [Sat, 18 Jan 2020 23:19:23 +0000 (18:19 -0500)]
css: Redo the pseudoclass selectors

There is no need to duplicate the classes, we can make
do with a single class for all the states.

6 years agocss: Go back to clearing out selectors
Matthias Clasen [Sat, 18 Jan 2020 22:55:58 +0000 (17:55 -0500)]
css: Go back to clearing out selectors

Now that we use the selector tree for change computation
again, we don't need the ruleset selectors anymore.
Bring back the code that cleans them out.

6 years agoUpdate Croatian translation
Goran Vidović [Sun, 19 Jan 2020 00:33:57 +0000 (00:33 +0000)]
Update Croatian translation

6 years agoUpdate Croatian translation
Goran Vidović [Sun, 19 Jan 2020 00:13:42 +0000 (00:13 +0000)]
Update Croatian translation

6 years agoRefine the selector tree printing
Matthias Clasen [Sat, 18 Jan 2020 19:18:47 +0000 (14:18 -0500)]
Refine the selector tree printing

Also show which tree nodes have exact matches.

6 years agoFix a css change testcase
Matthias Clasen [Sat, 18 Jan 2020 19:16:36 +0000 (14:16 -0500)]
Fix a css change testcase

The ui file here was invalid, leading to nonsensical
results.

6 years agoActually turn of css value accounting
Matthias Clasen [Sat, 18 Jan 2020 17:10:26 +0000 (12:10 -0500)]
Actually turn of css value accounting

We need an #undef here. While doing so, make sure
it compiles without warnings when disabled.

6 years agoinspector: Avoid an array overrun
Matthias Clasen [Sat, 18 Jan 2020 15:51:54 +0000 (10:51 -0500)]
inspector: Avoid an array overrun

Commit 3f56af373891bf6e3 added a new value to the
GdkInputSource enum, forgetting that the inspector
has an array of names to match this enum.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2385
6 years agowayland: Fix release build warnings
Matthias Clasen [Sat, 18 Jan 2020 07:34:56 +0000 (02:34 -0500)]
wayland: Fix release build warnings

6 years agox11: Fix release build warnings
Matthias Clasen [Sat, 18 Jan 2020 07:34:25 +0000 (02:34 -0500)]
x11: Fix release build warnings

6 years agoUpdate POTFILES.skip
Piotr Drąg [Sat, 18 Jan 2020 16:39:53 +0000 (17:39 +0100)]
Update POTFILES.skip

6 years agogl renderer: Pull a local variable in the closest scope
Timm Bäder [Fri, 17 Jan 2020 15:37:29 +0000 (16:37 +0100)]
gl renderer: Pull a local variable in the closest scope

6 years agocssimagefallback: Don't snapshot invisible colors
Timm Bäder [Thu, 16 Jan 2020 12:41:55 +0000 (13:41 +0100)]
cssimagefallback: Don't snapshot invisible colors

This avoids a few render nodes later.

6 years agowidget: Get opacity without GtkStyleContext
Timm Bäder [Thu, 16 Jan 2020 12:17:35 +0000 (13:17 +0100)]
widget: Get opacity without GtkStyleContext

GtkStyleContext is really just unnecessary here.

6 years agocssstyle: set font variations in get_pango_font()
Timm Bäder [Thu, 16 Jan 2020 10:33:12 +0000 (11:33 +0100)]
cssstyle: set font variations in get_pango_font()

Doesn't make sense to set all the css values on the font description in
there except for the font variations, so do these here as well.

6 years agowidget: Get DPI from style directly
Timm Bäder [Thu, 16 Jan 2020 10:30:14 +0000 (11:30 +0100)]
widget: Get DPI from style directly

Instead of going through GtkStyleContext.

6 years agocssstyle: Implement get_pango_font() directly
Timm Bäder [Thu, 16 Jan 2020 10:27:37 +0000 (11:27 +0100)]
cssstyle: Implement get_pango_font() directly

Instead of going through the slow GValue code path. This function was
unused, so use it in GtkWidget's update_pango_context() now.

6 years agotestsuite: Update expected css errors
Timm Bäder [Thu, 16 Jan 2020 08:56:46 +0000 (09:56 +0100)]
testsuite: Update expected css errors

6 years agogl renderer: Draw outset shadows white
Timm Bäder [Thu, 16 Jan 2020 07:02:48 +0000 (08:02 +0100)]
gl renderer: Draw outset shadows white

and only apply the actual shadow color when we draw them from the
texture. This way we can reuse the cached shadows during color
transitions.

6 years agocss: Mark transform value as computed
Matthias Clasen [Sun, 12 Jan 2020 01:09:56 +0000 (20:09 -0500)]
css: Mark transform value as computed

This is not very useful, since transitions generate
a ton of transforms anyway.

6 years agocss: Simplify default values
Matthias Clasen [Sun, 12 Jan 2020 00:05:39 +0000 (19:05 -0500)]
css: Simplify default values

We no longer need to create one-element arrays or
corners with two identical values.

6 years agocss: Re-add a lost special case
Matthias Clasen [Mon, 13 Jan 2020 12:34:08 +0000 (07:34 -0500)]
css: Re-add a lost special case

When the border-style special cases were moved in
c687f485fdd0a, the one for outline-width was lost.

Make the code more compact, and bring the special
case back.

6 years agocsshorthandproperty: Try to avoid allocating a GString for 1 font
Timm Bäder [Wed, 15 Jan 2020 12:18:16 +0000 (13:18 +0100)]
csshorthandproperty: Try to avoid allocating a GString for 1 font

6 years agocssdimensionvalue: remove early-out code from transition()
Timm Bäder [Wed, 15 Jan 2020 08:57:11 +0000 (09:57 +0100)]
cssdimensionvalue: remove early-out code from transition()

We do this directly in gtk_css_value_transition() now

6 years agogl renderer: Render simple border nodes in a simple way
Timm Bäder [Tue, 14 Jan 2020 14:43:53 +0000 (15:43 +0100)]
gl renderer: Render simple border nodes in a simple way

Roughly 80% of the border nodes are just one color and have the same
width on all sides, so we can draw them by uploading just one rect and
not four.

6 years agonumbervalue: Add early-out to multiply()
Timm Bäder [Tue, 14 Jan 2020 14:39:48 +0000 (15:39 +0100)]
numbervalue: Add early-out to multiply()

If the factor is 1, we already know what the result is going to be.

6 years agocssnumbervalue: Move early-out code to GtkCssValue
Timm Bäder [Tue, 14 Jan 2020 14:37:30 +0000 (15:37 +0100)]
cssnumbervalue: Move early-out code to GtkCssValue

These checks make sense for all css values.

6 years agocssdimensionvalue: Implement transition()
Timm Bäder [Tue, 14 Jan 2020 14:35:38 +0000 (15:35 +0100)]
cssdimensionvalue: Implement transition()

Instead of falling back to the generic gtk_css_number_value_transition
(which can allocate multiple new css values), just implement this here.

6 years agoRemove GtkCssShadowsValue
Timm Bäder [Tue, 14 Jan 2020 13:34:15 +0000 (14:34 +0100)]
Remove GtkCssShadowsValue

Previously, we wrapped all GtkCssShadowValues in a GtkCssShadowsValue,
even if it was just one shadow. This causes an unnecessary bloat in
css values.

Make each GtkCssShadowValue able to handle multiple shadows instead, and
use gtk_css_shadow_value* API everywhere.

6 years agocssshadowvalue: Only create 2 shadows values for transitions
Timm Bäder [Mon, 13 Jan 2020 07:37:52 +0000 (08:37 +0100)]
cssshadowvalue: Only create 2 shadows values for transitions

This is for cases where we want to transition from "no shadow" to
"shadow", which we need quite a lot.

6 years agocssvalue: Improve css value accounting output
Timm Bäder [Mon, 13 Jan 2020 09:19:56 +0000 (10:19 +0100)]
cssvalue: Improve css value accounting output

And make it fully optional behind an #ifdef.

6 years agocsscolorvalue: check for singletons in new_literal
Timm Bäder [Sun, 12 Jan 2020 14:53:26 +0000 (15:53 +0100)]
csscolorvalue: check for singletons in new_literal

Gets rid of another ~400 GtkCssValue instances in the widget-factory.

6 years agocssimage: Add is_computed vfunc
Timm Bäder [Sat, 11 Jan 2020 13:38:49 +0000 (14:38 +0100)]
cssimage: Add is_computed vfunc

Same semantics as the is_computed field of GtkCssValue

6 years agocss: Set the is_computed flag for more values
Timm Bäder [Sat, 11 Jan 2020 12:40:13 +0000 (13:40 +0100)]
css: Set the is_computed flag for more values

With these changes, we skip roughly 85% of compute() calls during
widget-factory startup

6 years agocssvalue: Don't call compute() for already computed css values
Timm Bäder [Sat, 11 Jan 2020 11:56:40 +0000 (12:56 +0100)]
cssvalue: Don't call compute() for already computed css values

As per the previous commit, this is unnecessary.

Even with the small amount of css values we mark as is_computed, we
already skip computing over 60% of them like this during the startup of
the widget factory.

6 years agocssvalue: Add is_computed flag
Timm Bäder [Sat, 11 Jan 2020 11:53:23 +0000 (12:53 +0100)]
cssvalue: Add is_computed flag

When a css value has "child" css values (e.g. a linear gradient has
several color stop css values) which are all computed (won't change when
compute() is called on them), we want to skip computing the entire
subtree.

Since css values are immutable, we can set the is_computed flag at
construct time.

Since GtkCssValue instances are 0-initialized in _gtk_css_value_alloc,
the default for is_computed it FALSE. This commit only sets it to TRUE
in a few cases, such as various "none" singleton values which will never
change. Later commits will refine this and set it for more values.

6 years agotestsuite: Update css color output
Timm Bäder [Sat, 11 Jan 2020 11:29:05 +0000 (12:29 +0100)]
testsuite: Update css color output

6 years agocss: Move border-width special cases out of GtkCssDimensionValue
Timm Bäder [Sat, 11 Jan 2020 11:22:19 +0000 (12:22 +0100)]
css: Move border-width special cases out of GtkCssDimensionValue

Move them to style computation instead, so we don't have them in such a
generic place.

6 years agocsscolorvalue: Don't copy rgbas when applying function
Timm Bäder [Sat, 11 Jan 2020 10:54:39 +0000 (11:54 +0100)]
csscolorvalue: Don't copy rgbas when applying function

We get const pointers to the colors, so just use those and unref the
values later.

6 years agogl renderer: Look at shadow color in the outset shadow cache
Timm Bäder [Sat, 11 Jan 2020 10:26:27 +0000 (11:26 +0100)]
gl renderer: Look at shadow color in the outset shadow cache

It would probably be better to not do this and always render the outline
in plain white, then later recolor it but do this for no, just for
correctness.

6 years agocssimageradial: Use array + length instead of GArray
Timm Bäder [Sat, 11 Jan 2020 09:00:25 +0000 (10:00 +0100)]
cssimageradial: Use array + length instead of GArray

This makes sense since we're not going to change the (amount of) colors
after parsing.

6 years agocssimagelinear: Use count+array for the color stops, not GArray
Timm Bäder [Sat, 11 Jan 2020 08:05:07 +0000 (09:05 +0100)]
cssimagelinear: Use count+array for the color stops, not GArray

This makse sense but will also make later changes to GtkCssImageLinear
simpler.

6 years agocssimagefallback: Don't compute new image if only a color is set
Timm Bäder [Sat, 11 Jan 2020 07:25:52 +0000 (08:25 +0100)]
cssimagefallback: Don't compute new image if only a color is set

Themes might use e.g. image(red), which is a constant value and will
never change. In that case, the fallback image has ->color set, but not
->images. If that's the case and the computed color is the same as
the one we already have, just return the already existing image.

6 years agoRemove GtkCssRgbaValue
Timm Bäder [Fri, 10 Jan 2020 12:02:33 +0000 (13:02 +0100)]
Remove GtkCssRgbaValue

The differenciation between a literal color value and an RGBA value
caused problems in various situations. Just treat the two the same but
don't allow access to the rgba value of a non-literal color value.

This gets rid of around 1.6k rgba values in the widget-factory.

6 years agodump css value stats
Matthias Clasen [Fri, 10 Jan 2020 04:48:30 +0000 (23:48 -0500)]
dump css value stats

6 years agocsssshadwovalue: Remove unused function prototype
Timm Bäder [Thu, 9 Jan 2020 11:52:20 +0000 (12:52 +0100)]
csssshadwovalue: Remove unused function prototype

6 years agocssnumbervalue: Add early-outs to transition code
Timm Bäder [Wed, 8 Jan 2020 08:42:23 +0000 (09:42 +0100)]
cssnumbervalue: Add early-outs to transition code

we don't need to do the calculation at all if the progress is 0 or 1
anyway.

We also sometimes transition from 0 to 0 etc., so we can short-circuit
that as well by doing the fast pointer-equality check and relying on the
singletons.

6 years agocsscornervalue: Accept other values if x == y
Timm Bäder [Wed, 8 Jan 2020 08:11:02 +0000 (09:11 +0100)]
csscornervalue: Accept other values if x == y

Most corners are square, so x == y. In that case, just accept either of
them. This makes the corner value unnecessary.

In fact none of the corner values in the widget-factory are needed, so
this spares us around 500 corner value allocations.

css value stats before:

GtkCssBgSizeValue: 23
GtkCssIdentValue: 25
GtkCssPositionValue: 81
GtkCssCornerValue: 556
GtkCssArrayValue: 143
GtkCssStringValue: 33
GtkCssPaletteValue: 29
GtkCssImageValue: 2765
GtkCssColorValue: 1452
GtkCssFilterValue: 3
GtkCssRgbaValue: 1092
GtkCssShadowValue: 708
GtkCssEaseValue: 33
GtkCssBorderValue: 2
GtkCssTransformValue: 11
GtkCssDimensionValue: 882
GtkCssShadowsValue: 584
SUM: 8428

and after:

GtkCssColorValue: 1452
GtkCssFilterValue: 3
GtkCssRgbaValue: 1092
GtkCssShadowValue: 708
GtkCssEaseValue: 33
GtkCssBorderValue: 2
GtkCssTransformValue: 11
GtkCssDimensionValue: 882
GtkCssShadowsValue: 584
GtkCssBgSizeValue: 23
GtkCssIdentValue: 25
GtkCssPositionValue: 81
GtkCssArrayValue: 143
GtkCssStringValue: 33
GtkCssPaletteValue: 29
GtkCssImageValue: 2765
SUM: 7872

8428 to 7872 is a 556 reduction (6.5%)

asdf

6 years agocssarrayvalue: Don't allocate memory when parsing array values
Timm Bäder [Wed, 8 Jan 2020 07:58:07 +0000 (08:58 +0100)]
cssarrayvalue: Don't allocate memory when parsing array values

We probably won't find CSS with more than 128 values in array.

6 years agocssarrayvalue: Allow calling array API on non-arrays
Timm Bäder [Wed, 8 Jan 2020 07:37:04 +0000 (08:37 +0100)]
cssarrayvalue: Allow calling array API on non-arrays

Just allow calling _get_nth() and _get_n_values() on every kind of css
value. This way we can allow all values in places where only array
values would be allowed before.

This spares us around 1000 array values in the widget factory.

css value stats before:

GtkCssFilterValue: 3
GtkCssRgbaValue: 1092
GtkCssShadowValue: 708
GtkCssEaseValue: 33
GtkCssBorderValue: 2
GtkCssTransformValue: 11
GtkCssDimensionValue: 882
GtkCssShadowsValue: 584
GtkCssBgSizeValue: 23
GtkCssIdentValue: 25
GtkCssPositionValue: 81
GtkCssCornerValue: 556
GtkCssArrayValue: 1130
GtkCssStringValue: 33
GtkCssPaletteValue: 29
GtkCssImageValue: 2765
GtkCssColorValue: 1452
SUM: 9415

and after:

GtkCssBgSizeValue: 23
GtkCssIdentValue: 25
GtkCssPositionValue: 81
GtkCssCornerValue: 556
GtkCssArrayValue: 143
GtkCssStringValue: 33
GtkCssPaletteValue: 29
GtkCssImageValue: 2765
GtkCssColorValue: 1452
GtkCssFilterValue: 3
GtkCssRgbaValue: 1092
GtkCssShadowValue: 708
GtkCssEaseValue: 33
GtkCssBorderValue: 2
GtkCssTransformValue: 11
GtkCssDimensionValue: 882
GtkCssShadowsValue: 584
SUM: 8428

9415 to 8428 is a 987 reduction (10.4%)

6 years agocssvalue: Add type names for all classes
Timm Bäder [Thu, 9 Jan 2020 10:57:00 +0000 (11:57 +0100)]
cssvalue: Add type names for all classes

This is important to have for debugging and e.g. to print statistics for
the individual css value types